#!/bin/sh

if [ -n "`%OPTWARE_TARGET_PREFIX%/bin/pidof byRequest`" ] ; then
    %OPTWARE_TARGET_PREFIX%/bin/killall byRequest 2>/dev/null
fi

if [ ! -f %OPTWARE_TARGET_PREFIX%/etc/byRequest.conf ] ;  then
    cp %OPTWARE_TARGET_PREFIX%/usr/doc/byRequest/byRequest.conf %OPTWARE_TARGET_PREFIX%/etc/byRequest.conf
    echo ; echo
    echo "To complete the installation, you must edit %OPTWARE_TARGET_PREFIX%/etc/byRequest.conf,"
    echo "and then run %OPTWARE_TARGET_PREFIX%/etc/init.d/S99byRequest to start the byRequest daemon."
    echo "e.g. You might want to set the logfile to /dev/null."
    echo
else
    %OPTWARE_TARGET_PREFIX%/etc/init.d/S99byRequest
fi
